/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Core.impl.IdentifiedObjectImpl;

import EA_Model.IEC61970.Domain.AngleDegrees;
import EA_Model.IEC61970.Domain.Impedance;
import EA_Model.IEC61970.Domain.KWActivePower;
import EA_Model.IEC61970.Domain.PerCent;
import EA_Model.IEC61970.Domain.Voltage;

import EA_Model.IEC61970.Wires.WindingTest;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Winding Test</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getExcitingCurrent <em>Exciting Current</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getFromTapStep <em>From Tap Step</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getLeakageImpedance <em>Leakage Impedance</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getLoadLoss <em>Load Loss</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getNoLoadLoss <em>No Load Loss</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getPhaseShift <em>Phase Shift</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getToTapStep <em>To Tap Step</em>}</li>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.WindingTestImpl#getVoltage <em>Voltage</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class WindingTestImpl extends IdentifiedObjectImpl implements WindingTest {
	/**
	 * The cached value of the '{@link #getExcitingCurrent() <em>Exciting Current</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getExcitingCurrent()
	 * @generated
	 * @ordered
	 */
	protected PerCent excitingCurrent;

	/**
	 * The cached value of the '{@link #getFromTapStep() <em>From Tap Step</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFromTapStep()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Integer fromTapStep;

	/**
	 * The cached value of the '{@link #getLeakageImpedance() <em>Leakage Impedance</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLeakageImpedance()
	 * @generated
	 * @ordered
	 */
	protected Impedance leakageImpedance;

	/**
	 * The cached value of the '{@link #getLoadLoss() <em>Load Loss</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getLoadLoss()
	 * @generated
	 * @ordered
	 */
	protected KWActivePower loadLoss;

	/**
	 * The cached value of the '{@link #getNoLoadLoss() <em>No Load Loss</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNoLoadLoss()
	 * @generated
	 * @ordered
	 */
	protected KWActivePower noLoadLoss;

	/**
	 * The cached value of the '{@link #getPhaseShift() <em>Phase Shift</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPhaseShift()
	 * @generated
	 * @ordered
	 */
	protected AngleDegrees phaseShift;

	/**
	 * The cached value of the '{@link #getToTapStep() <em>To Tap Step</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getToTapStep()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Integer toTapStep;

	/**
	 * The cached value of the '{@link #getVoltage() <em>Voltage</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getVoltage()
	 * @generated
	 * @ordered
	 */
	protected Voltage voltage;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected WindingTestImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.WINDING_TEST;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent getExcitingCurrent() {
		if (excitingCurrent != null && excitingCurrent.eIsProxy()) {
			InternalEObject oldExcitingCurrent = (InternalEObject)excitingCurrent;
			excitingCurrent = (PerCent)eResolveProxy(oldExcitingCurrent);
			if (excitingCurrent != oldExcitingCurrent) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__EXCITING_CURRENT, oldExcitingCurrent, excitingCurrent));
			}
		}
		return excitingCurrent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public PerCent basicGetExcitingCurrent() {
		return excitingCurrent;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setExcitingCurrent(PerCent newExcitingCurrent) {
		PerCent oldExcitingCurrent = excitingCurrent;
		excitingCurrent = newExcitingCurrent;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__EXCITING_CURRENT, oldExcitingCurrent, excitingCurrent));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer getFromTapStep() {
		if (fromTapStep != null && fromTapStep.eIsProxy()) {
			InternalEObject oldFromTapStep = (InternalEObject)fromTapStep;
			fromTapStep = (EA_Model.IEC61970.Domain.Integer)eResolveProxy(oldFromTapStep);
			if (fromTapStep != oldFromTapStep) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__FROM_TAP_STEP, oldFromTapStep, fromTapStep));
			}
		}
		return fromTapStep;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer basicGetFromTapStep() {
		return fromTapStep;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFromTapStep(EA_Model.IEC61970.Domain.Integer newFromTapStep) {
		EA_Model.IEC61970.Domain.Integer oldFromTapStep = fromTapStep;
		fromTapStep = newFromTapStep;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__FROM_TAP_STEP, oldFromTapStep, fromTapStep));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Impedance getLeakageImpedance() {
		if (leakageImpedance != null && leakageImpedance.eIsProxy()) {
			InternalEObject oldLeakageImpedance = (InternalEObject)leakageImpedance;
			leakageImpedance = (Impedance)eResolveProxy(oldLeakageImpedance);
			if (leakageImpedance != oldLeakageImpedance) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE, oldLeakageImpedance, leakageImpedance));
			}
		}
		return leakageImpedance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Impedance basicGetLeakageImpedance() {
		return leakageImpedance;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLeakageImpedance(Impedance newLeakageImpedance) {
		Impedance oldLeakageImpedance = leakageImpedance;
		leakageImpedance = newLeakageImpedance;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE, oldLeakageImpedance, leakageImpedance));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public KWActivePower getLoadLoss() {
		if (loadLoss != null && loadLoss.eIsProxy()) {
			InternalEObject oldLoadLoss = (InternalEObject)loadLoss;
			loadLoss = (KWActivePower)eResolveProxy(oldLoadLoss);
			if (loadLoss != oldLoadLoss) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__LOAD_LOSS, oldLoadLoss, loadLoss));
			}
		}
		return loadLoss;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public KWActivePower basicGetLoadLoss() {
		return loadLoss;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setLoadLoss(KWActivePower newLoadLoss) {
		KWActivePower oldLoadLoss = loadLoss;
		loadLoss = newLoadLoss;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__LOAD_LOSS, oldLoadLoss, loadLoss));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public KWActivePower getNoLoadLoss() {
		if (noLoadLoss != null && noLoadLoss.eIsProxy()) {
			InternalEObject oldNoLoadLoss = (InternalEObject)noLoadLoss;
			noLoadLoss = (KWActivePower)eResolveProxy(oldNoLoadLoss);
			if (noLoadLoss != oldNoLoadLoss) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__NO_LOAD_LOSS, oldNoLoadLoss, noLoadLoss));
			}
		}
		return noLoadLoss;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public KWActivePower basicGetNoLoadLoss() {
		return noLoadLoss;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNoLoadLoss(KWActivePower newNoLoadLoss) {
		KWActivePower oldNoLoadLoss = noLoadLoss;
		noLoadLoss = newNoLoadLoss;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__NO_LOAD_LOSS, oldNoLoadLoss, noLoadLoss));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AngleDegrees getPhaseShift() {
		if (phaseShift != null && phaseShift.eIsProxy()) {
			InternalEObject oldPhaseShift = (InternalEObject)phaseShift;
			phaseShift = (AngleDegrees)eResolveProxy(oldPhaseShift);
			if (phaseShift != oldPhaseShift) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__PHASE_SHIFT, oldPhaseShift, phaseShift));
			}
		}
		return phaseShift;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AngleDegrees basicGetPhaseShift() {
		return phaseShift;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPhaseShift(AngleDegrees newPhaseShift) {
		AngleDegrees oldPhaseShift = phaseShift;
		phaseShift = newPhaseShift;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__PHASE_SHIFT, oldPhaseShift, phaseShift));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer getToTapStep() {
		if (toTapStep != null && toTapStep.eIsProxy()) {
			InternalEObject oldToTapStep = (InternalEObject)toTapStep;
			toTapStep = (EA_Model.IEC61970.Domain.Integer)eResolveProxy(oldToTapStep);
			if (toTapStep != oldToTapStep) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__TO_TAP_STEP, oldToTapStep, toTapStep));
			}
		}
		return toTapStep;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Integer basicGetToTapStep() {
		return toTapStep;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setToTapStep(EA_Model.IEC61970.Domain.Integer newToTapStep) {
		EA_Model.IEC61970.Domain.Integer oldToTapStep = toTapStep;
		toTapStep = newToTapStep;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__TO_TAP_STEP, oldToTapStep, toTapStep));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Voltage getVoltage() {
		if (voltage != null && voltage.eIsProxy()) {
			InternalEObject oldVoltage = (InternalEObject)voltage;
			voltage = (Voltage)eResolveProxy(oldVoltage);
			if (voltage != oldVoltage) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, WiresPackage.WINDING_TEST__VOLTAGE, oldVoltage, voltage));
			}
		}
		return voltage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Voltage basicGetVoltage() {
		return voltage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setVoltage(Voltage newVoltage) {
		Voltage oldVoltage = voltage;
		voltage = newVoltage;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.WINDING_TEST__VOLTAGE, oldVoltage, voltage));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.WINDING_TEST__EXCITING_CURRENT:
				if (resolve) return getExcitingCurrent();
				return basicGetExcitingCurrent();
			case WiresPackage.WINDING_TEST__FROM_TAP_STEP:
				if (resolve) return getFromTapStep();
				return basicGetFromTapStep();
			case WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE:
				if (resolve) return getLeakageImpedance();
				return basicGetLeakageImpedance();
			case WiresPackage.WINDING_TEST__LOAD_LOSS:
				if (resolve) return getLoadLoss();
				return basicGetLoadLoss();
			case WiresPackage.WINDING_TEST__NO_LOAD_LOSS:
				if (resolve) return getNoLoadLoss();
				return basicGetNoLoadLoss();
			case WiresPackage.WINDING_TEST__PHASE_SHIFT:
				if (resolve) return getPhaseShift();
				return basicGetPhaseShift();
			case WiresPackage.WINDING_TEST__TO_TAP_STEP:
				if (resolve) return getToTapStep();
				return basicGetToTapStep();
			case WiresPackage.WINDING_TEST__VOLTAGE:
				if (resolve) return getVoltage();
				return basicGetVoltage();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.WINDING_TEST__EXCITING_CURRENT:
				setExcitingCurrent((PerCent)newValue);
				return;
			case WiresPackage.WINDING_TEST__FROM_TAP_STEP:
				setFromTapStep((EA_Model.IEC61970.Domain.Integer)newValue);
				return;
			case WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE:
				setLeakageImpedance((Impedance)newValue);
				return;
			case WiresPackage.WINDING_TEST__LOAD_LOSS:
				setLoadLoss((KWActivePower)newValue);
				return;
			case WiresPackage.WINDING_TEST__NO_LOAD_LOSS:
				setNoLoadLoss((KWActivePower)newValue);
				return;
			case WiresPackage.WINDING_TEST__PHASE_SHIFT:
				setPhaseShift((AngleDegrees)newValue);
				return;
			case WiresPackage.WINDING_TEST__TO_TAP_STEP:
				setToTapStep((EA_Model.IEC61970.Domain.Integer)newValue);
				return;
			case WiresPackage.WINDING_TEST__VOLTAGE:
				setVoltage((Voltage)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.WINDING_TEST__EXCITING_CURRENT:
				setExcitingCurrent((PerCent)null);
				return;
			case WiresPackage.WINDING_TEST__FROM_TAP_STEP:
				setFromTapStep((EA_Model.IEC61970.Domain.Integer)null);
				return;
			case WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE:
				setLeakageImpedance((Impedance)null);
				return;
			case WiresPackage.WINDING_TEST__LOAD_LOSS:
				setLoadLoss((KWActivePower)null);
				return;
			case WiresPackage.WINDING_TEST__NO_LOAD_LOSS:
				setNoLoadLoss((KWActivePower)null);
				return;
			case WiresPackage.WINDING_TEST__PHASE_SHIFT:
				setPhaseShift((AngleDegrees)null);
				return;
			case WiresPackage.WINDING_TEST__TO_TAP_STEP:
				setToTapStep((EA_Model.IEC61970.Domain.Integer)null);
				return;
			case WiresPackage.WINDING_TEST__VOLTAGE:
				setVoltage((Voltage)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.WINDING_TEST__EXCITING_CURRENT:
				return excitingCurrent != null;
			case WiresPackage.WINDING_TEST__FROM_TAP_STEP:
				return fromTapStep != null;
			case WiresPackage.WINDING_TEST__LEAKAGE_IMPEDANCE:
				return leakageImpedance != null;
			case WiresPackage.WINDING_TEST__LOAD_LOSS:
				return loadLoss != null;
			case WiresPackage.WINDING_TEST__NO_LOAD_LOSS:
				return noLoadLoss != null;
			case WiresPackage.WINDING_TEST__PHASE_SHIFT:
				return phaseShift != null;
			case WiresPackage.WINDING_TEST__TO_TAP_STEP:
				return toTapStep != null;
			case WiresPackage.WINDING_TEST__VOLTAGE:
				return voltage != null;
		}
		return super.eIsSet(featureID);
	}

} //WindingTestImpl
